package com.ben.xinyue.seckill.util;

import jodd.util.StringUtil;

import java.util.regex.Pattern;

/**
 * @ClassName: ValidatorUtil
 * @Description: 校验工具类
 * @author: xinyue
 * @date: 2020/9/2 11:06 下午
 * @version: 1.0.0
 */
public class ValidatorUtil {

    private static final Pattern MOBILE_PATTERN  = Pattern.compile("^1\\d{10}$");

    private ValidatorUtil(){
        throw new RuntimeException("工具类不允许初始化!");
    }

    public static boolean isMobile(String src){
        if(StringUtil.isBlank(src)){
            return false;
        }
        return MOBILE_PATTERN.matcher(src).matches();
    }
}
